module.exports = function($scope, $state, create, place_code){

	$scope.objt = {};

	$scope.objt.state = '1';
	$scope.objt.asort = '0';
	$scope.objt.place_code = '';

	$scope.loadPlaceList = function(){
		place_code.save({}, function(res){
			if(res.errcode === 0) {
				$scope.place_list = res.data;
				$scope.place_list.unshift({'name': '系统公告', 'code': ''});
			} else {
				alert(res.errmsg);
			}
		});
	};
	$scope.loadPlaceList();

	$scope.gogo = function(){
		create.save($scope.objt, function(res){
			if(res.errcode === 0) {
				$state.go('app.createnotice');
			} else {
				alert(res.errmsg);
			}
		});
	};
	
};